package enum1;

/**
 * @program: baseModule
 * @description:
 * @author: zhanghz001
 * @create: 2020-10-28 17:14
 **/
public enum Season {
    //第一行必须是枚举项,分号在枚举还有其他东西的时候是必须的
    SPRING("春", 1) {
        @Override
        void seson1() {
            System.out.println("抽象方法复写");
        }
    }, SUMMER("夏") {
        @Override
        void seson1() {
            System.out.println("抽象方法复写");
        }
    }, AUTUMN("秋") {
        @Override
        void seson1() {
            System.out.println("抽象方法复写");
        }
    }, WINTER("冬") {
        @Override
        void seson1() {

        }
    };
    private String name;
    private int index;

    abstract void seson1();

    private Season(String name) {
        this.name = name;
    }

    Season(String name, int index) {
        this.name = name;
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
